package com.brower.project.utils

import com.tencent.mmkv.MMKV

class CookiePreferences {
    companion object {
        private const val PREF_COOKIES = "pref_cookies"


        fun saveCookie(set: HashSet<String>) {
            MMKV.defaultMMKV().putStringSet(PREF_COOKIES, set)
        }

        fun getCookie(): HashSet<String>? {
            val set = MMKV.defaultMMKV().getStringSet(PREF_COOKIES, null)
            if (set != null) {
                return set as HashSet<String>
            }
            return null
        }

        fun clearCookie() {
            MMKV.defaultMMKV().remove(PREF_COOKIES)
        }
    }
}